<html>

<style>
table {
  border-collapse: collapse;
  border-spacing: none;
  }

thead th {
  background-color: #F7BE81;
  font-size: 12px;
  font-family: sans-serif;
  border:none;
  }

tbody td {
  font-size: 12px;
}

tr td:first-child,
tr th:first-child {
      border-top-left-radius: 6px;
      border-bottom-left-radius: 6px;
}

tr td:last-child,
tr th:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
</style>



<!--</br> Customer: <select ng-model="clist" ng-options="cust.Name+' ('+cust.custtype+')' for cust in customermast"></select>
        <tt>Customer Details={{clist.custtype}}</tt>
        <tt>Total Customers are ={{customermast.length}}</tt> 
 <div class="container">
  <table>
      <tr>
        <td>Type : 
	<select>
        <option id="CUSTOMER">CUSTOMER</option>
        <option id="DISTRIBUTOR">DISTRIBUTOR</option>
		<option id="AGENT">AGENT</option>
     </select>
     </td>
	
    <td>Prefix :
      <select>
        <option id="MR" ng-selected="selected">MR</option>
         <option id="MRS">MRS</option>
         <option id="M/S">M/S</option>
       </select>
    </td>
	<td>Name : </td> <td><input type="text" ng-model="name"/> </td>
	</tr>
    
    <tr>
     <td>Address :<textarea name="address" ng-model="address"></textarea></td>
        <td>City :<input type="text" ng-model="city" ng-model="city"></td>
		</tr>
        <tr>
        <td>Email Id : <input type="email" name="input" ng-model="email" ></td>
        <td>Phone : <input type="text" ng-model="phoneno"/></td>
	    </tr>
  </table>
      <button ng-click="save()" ng-disabled="Form.$invalid" class="btn btn-primary">Save</button>
      <input type="text" ng-model="name" class="search-query" placeholder="Search">        
    </div>
<a class="btn btn-primary" href="#/add-user">Add New Customer</a>

<!--
<form novalidate name="AddNewForm" id="add-new-form" method="post" action="">
  <label for="username">Username:</label>
  <input type="text" ng-model="user.username" required />
  <label for="first_name">First name:</label>
  <input type="text" ng-model="user.first_name" required />
  <label for="last_name">Last name:</label>
  <input type="text" ng-model="user.last_name" required />
  <label for="address">Address:</label>
  <input type="text" ng-model="user.address" />
  <br/>
  <button class="btn btn-primary" ng-disabled="AddNewForm.$invalid || isUnchanged(user)" id="add-new-btn" ng-click="add_new(user)">Save!</button>
  <a href="#/" class="btn">Cancel</a>
</form> -->
<div ng-app="myApp" ng-controller="ListCustCtrl">
 <h3>Customer Master</h3> <!--class = "well" -->
 <form  novalidate name="UpdateCustForm" id="update-cust-form" method="post" action="">
  <table>
   <tr>
    <td>Type :<select name = "custtype" ng-model="newcustomermast.custtype">
        <option id="CUSTOMER">CUSTOMER</option> <option id="DISTRIBUTOR">DISTRIBUTOR</option>
    	<option id="AGENT">AGENT</option> <option id="CORPORATE">CORPORATE</option>
		<option id="VENDOR">VENDOR</option>
    </select>
    <!-- "ng-options="type.name as type.name for type in custcat"></select>
       {{cust.custtype | json}} -->
     </td>
    <td>Prefix :<select name="prefx" ng-model="newcustomermast.prefx">
      <option id="Mr">Mr</option> <option id="M/s">M/s</option> <option id="Mrs">Mrs</option>  </select>
     <!-- {{selectedItem | json}} -->
    </td> 
	<td>Name : <input type="text" name="Name" ng-model="newcustomermast.Name" capitalize/> </td>
    <td>Address :<textarea rows = "3" name="address" ng-model="newcustomermast.Address" capitalize></textarea></td>
	</tr>
    
    <tr>
    <td>City :<input type="text" name = "city" ng-model="newcustomermast.city" capitalize></td>
    <td>Email Id : <input type="text" name = "email" ng-model="newcustomermast.email"></td>
    <td>Phone :  <input type="text" name = "phoneno" ng-model="newcustomermast.phoneno"></td>
	<td>Admin Charges :  <input type="text" name = "appadmchrg" ng-model="newcustomermast.appadmchrg"></td>
	</tr>
   </table>
   <!--<ng-disabled="UpdateCustForm.$invalid || isUnchanged(newcustomermast)" 
    <!-- <button class="btn btn-success" id="upt-exit-btn" ng-click="updtcustdata(newcustomermast)">Update</button> -->
    <a class="btn btn-success" href="#/updtcustdata/" ng-click="updtcustdata(newcustomermast)">Update</a>
    <a href="#/editcust/" ng-click="cancel()" class="btn">Cancel</a>
    <a class="btn btn-info pull-right" href="#/add-user">Add New Customer</a>
    <input type="text" ng-model="name" class="search-query" placeholder="Search">
     
       
<!-- <div ng-controller="ListCustCtrl"> -->
            <table class="table table-striped table-condensed table-hover">
                <thead>
                    <tr>
                         <!--<th class="id">Id&nbsp;<a ng-click="sort_by('Sr_NO')"><i class="icon-sort"></i></a></th>
                         <th class="name">Customer Name&nbsp;<a ng-click="sort_by('Name')"><i class="icon-sort"></i></a></th> 
                         <th><a href="" ng-click="predicate = 'Name'; reverse=!reverse">Customer Name</a></th>
                         <th class="address">Address&nbsp;<a ng-click="sort_by('Address')"><i class="icon-sort"></i></a></th>
                         <th class="city">City&nbsp;<a ng-click="sort_by('city')"><i class="icon-sort"></i></a></th>
                         <th class="phone">Phone&nbsp;<a ng-click="sort_by('phone')"><i class="icon-sort"></i></a></th>
                         <th class="email">Email&nbsp;<a ng-click="sort_by('email')"><i class="icon-sort"></i></a></th>
                         <th class="custtype">Type&nbsp;<a ng-click="sort_by('custtype')"><i class="icon-sort"></i></a></th>  -->
                         <th>Id</th>
                         <th>Prefix</th>
                         <th><a href="" ng-click="predicate = 'Name'; reverse=!reverse">Customer Name</a></th>
                         <th>Address</th>
                         <th>City</th>
                         <th>Phone No</th>
                         <th>Email</th>
                         <th>Type</th>
						 <th>Admin Chrg</th>
                         <th>Status</th>
                         <th>Delete</th>
                         <th>Edit</th>
                   </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in customermast | filter: name | orderBy:predicate:reverse | startingFrom:currentPage*pageSize | limitTo:pageSize">
                         <td>{{item.custid}}</td>
                         <td>{{item.prefx}}</td>
                         <td>{{item.Name}}</td>      
                         <td>{{item.Address}}</td> 
                         <td>{{item.city}}</td> 
                         <td>{{item.phoneno}}</td> 
                         <td>{{item.email}}</td> 
                         <td>{{item.custtype}}</td>
						 <td>{{item.appadmchrg}}</td>
                         <td>{{item.status}}</td>
                         <td><a href="#/editcust/" ng-click="deletecust(item.Name)"> <img src="glyphicons_bin.png" alt="Delete"/></td> 
                    <!--     <td><a href="#/editcust/{{item.custid}}" ng-click="editcust(item.custid)"> <img src="glyphicons_edit.png" alt="Edit"/></td> -->
                         <td><a href="#/editcust/" ng-click="edit(item.custid)"> <img src="glyphicons_edit.png" alt="Edit"/></td> 
                    </tr>
               </tbody>
              <!--  <tr ng-show="editId===item.custid" ng-if="editId===item.custid">
            <td colspan="7" ng-include src="'editRow.html'"></td>
        </tr>-->
			
            </table>
    <!-- <button ng-disabled="currentPage == 0" ng-click="currentPage=currentPage-1">Previous</button>
				{{currentPage+1}}/{{customermast.length/pageSize}}
				<button ng-disabled="currentPage >= customermast.length/pageSize - 1" ng-click="currentPage=currentPage+1">
				Next pagedItems
				</button> -->
               
             <tfoot>
             Current Page  {{currentPage+1}} of {{customermast.length/pageSize}}
                    <td colspan="6">
                        <div class="pagination pull-right">
                            <ul>
                              <!--  <li ng-class="{disabled: currentPage == 0}">
                                    <a href ng-click="currentPage=currentPage-1">« Prev</a> 
                                </li>-->
                <button ng-disabled="currentPage == 0" ng-click="currentPage=currentPage-1"> « Prev </button>
                                
                         <li ng-repeat="n in range(customermast.length)"
                                    ng-class="{active: n == currentPage}"
                                    ng-click="setPage()">
                                    <a href ng-bind="n + 1">1</a>
                                </li> 
                    <!--    <li ng-class="{disabled: currentPage >= customermast.length/pageSize - 1 }">
                                    <a href ng-click="currentPage=currentPage+1">Next »</a>  -->
        <button ng-disabled="currentPage >= customermast.length/pageSize - 1" ng-click="currentPage=currentPage+1">
        Next »
    </button>
       </li>
      </ul>
    </div>
  </td>
  </tfoot>
       </div>  
  </body>
</html>
